// https: // iai.sh.cn/problem/728

#include <bits/stdc++.h>

using namespace std;

int main() {

  string p, t;
  cin >> p >> t;
  int i = 0, j = 0;
  while (i < p.size() && j < t.size()) {
    if (p[i] == t[j]) {
      i++;
    }
    j++;
  }
  /*  if (t.find(p) != string::npos) {
     cout << "Yes" << endl;
   } else {
     cout << "No" << endl;
   } */
  if (i == p.size()) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}